#include <stdio.h>

int main() {
	int i = 0;
	char a[40], b[40];
	gets (a);
	while (a[i] != '\0') {
		if (a[i] < 91 && a[i] > 64)
			b[i] = a[i] + 32;
		else if (a[i] < 123 && a[i] > 96)
			b[i] = a[i] - 32;
		else
			b[i] = a[i];
		i++;
	}
	b[i] = '\0';
	puts(b);
}
